import component from "../../../../common/component";
import {Button} from "antd";
import EditModal from "./edit";
import EditAndDelBtn from "@/components/EditAndDelBtn"

class fixed extends component {
     //右上角 新建设备类型与删除选中 按钮
    //  getJobTitle = (code) => {
    //     switch (code) {
    //       case 0:
    //         return '讲师';
    //       case 1:
    //         return '副教授';
    //       case 2:
    //         return '教授';
    //       default:
    //         return '';
    //     }
    //   };
    getButtonRow(): null {
        return <>
            <Button className={'button-delete button-default'} onClick={this.handleAdd} type="primary" >
                    新增信息
            </Button>
        </>;
    }
    //主体部分页眉
    getColumns(): null {
        return [
            {
                title: '姓名',
                dataIndex: 'name',
                key: 'name',
                width: 150,
            },
            {
                title: '职务',
                dataIndex: 'duties',
                key: 'duties',
                width: 150,          
                
            },
            {
                title: '职称',
                dataIndex: 'title',
                key: 'title',
                width: 300,
             },
            {
                title: '单位',
                dataIndex: 'unit',
                key: 'unit',
                width: 100,
            },
            {
                title: '操作',
                dataIndex: 'operation',
                fixed: 'right',
                width: 100,
                render: (_, record) => {
                    return <EditAndDelBtn record={record} edit={this.edit} del={this.delete}/>
                },
            }
        ];
    }


    getEditModal(): null {
        return <EditModal {...this.state.editParam} cancelModal={this.cancelModal} reload={this.reload}
                          baseUir={this.state.baseUri}/>
    }
}

export default fixed;

